Although there’s not much to see, the default website
is ready for action as soon as you install IIS. To access the website
from the computer running IIS, you can enter any of the following
addresses into your web browser:
http://127.0.0.1/
http://localhost/
http://IPAddress/ (replace IPAddress with the IP address of the computer)
http://ComputerName/ (replace ComputerName with name of the computer)
Figure 28.2 shows the home page of the default IIS website that appears.
Creating a Windows Firewall Exception for the Web Server
As things stand now,
your new website will only work properly when you access it using a web
browser running on the Windows 7 PC that’s running IIS. If you try to
access the site on any other computer (or from a location outside your
network), you get an error message, as shown in Figure 2.
The
problem is that the Windows Firewall on the Windows 7 machine hasn’t
been configured to allow data traffic through the World Wide Web
Services used by IIS. For your website to work from any remote location,
you need to set up an exception for the World Wide Web Services in
Windows Firewall. Here are the steps to follow:
1. | Select Start, type firewall, and then click Allow a Program through Windows Firewall in the search results. The Allowed Programs window appears.
|
2. | Click Change Settings to enable the window controls.
|
3. | Click to activate the check box beside the World Wide Web Services (HTTP) item, as shown in Figure 3.
Note
HTTP is short for Hypertext Transport Protocol, the protocol used to exchange information on the World Wide Web.
|
4. | Click OK to put the exception into effect.
|
Accessing Your Website over the Network
With the Windows
Firewall exception for the World Wide Web Services in place, you can now
access the website from any remote computer on your network. You do
this by launching your web browser and entering one of the following
addresses:
http://IPAddress/ (replace IPAddress with the IP address of the IIS computer)
http://ComputerName/ (replace ComputerName with name of the IIS computer)
For example, Figure 4 shows Internet Explorer accessing the same IP address as shown earlier in Figure 2, but now instead of an error the user sees the default IIS site.
Accessing Your Website over the Internet
People
on your network can now access your website, but you may also want to
allow website access to people from outside your network (that is, from
the Internet). To set this up, you must do three things:
1. | Set up the Windows 7 machine that’s hosting the website with a permanent IP address.
|
2. | Configure your router to forward TCP traffic on port 80 to the IP address you specified in step 1.
|
3. | (Optional)
If you want people to access your website using a domain name, you need
to sign up for and configure a dynamic domain name system (DDNS)
service.
|
An Internet user can now access your website by entering the following addresses into a web browser:
http://IPAddress/ (replace IPAddress with your router's external IP address)
http://DomainName/ (replace DomainName with your Dynamic DNS domain name)
I set up a DDNS service to map the domain paulmcfedries.com
to my local network, and then configured my router to forward web
traffic to my Windows 7 machine running IIS. As you can see in Figure 5, entering the address http://www.paulmcfedries.com/ brings up the default IIS website.
Note
No, I don’t currently run my own website, although I did for many years. Chances are if you try http://www.paulmcfedries.com/, you won’t get very far.